<?php /*a:2:{s:99:"D:\PHP\phpstudy_pro\WWW\shixun24\zmtApp\public/themes/admin_simpleboot3/app\goods\get_attr_val.html";i:1718933190;s:90:"D:\PHP\phpstudy_pro\WWW\shixun24\zmtApp\public/themes/admin_simpleboot3/public\header.html";i:1690974980;}*/ ?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <!-- Set render engine for 360 browser -->
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <!-- HTML5 shim for IE8 support of HTML5 elements -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <![endif]-->


    <link href="/themes/admin_simpleboot3/public/assets/themes/<?php echo cmf_get_admin_style(); ?>/bootstrap.min.css" rel="stylesheet">
    <link href="/themes/admin_simpleboot3/public/assets/simpleboot3/css/simplebootadmin.css" rel="stylesheet">
    <link href="/static/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <!--[if lt IE 9]>
    <script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <style>
        form .input-order {
            margin-bottom: 0px;
            padding: 0 2px;
            width: 42px;
            font-size: 12px;
        }

        form .input-order:focus {
            outline: none;
        }

        .table-actions {
            margin-top: 5px;
            margin-bottom: 5px;
            padding: 0px;
        }

        .table-list {
            margin-bottom: 0px;
        }

        .form-required {
            color: red;
        }

        .td-actions .btn {
            margin-bottom: 2px;
            min-width: 96px;
            text-align: center;
        }

        .td-actions .btn:last-child {
            margin-bottom: 0;
        }
        a:hover, a:focus{
            text-decoration: none;
        }
    </style>
    <?php 
		$is_mobile=cmf_is_mobile();
        $_static_version='1.0.4';
        $cmf_version=cmf_version();
        if (strpos(cmf_version(), '6.') === 0) {
            $_app=app()->http->getName();
        }else{
            $_app=request()->module();
        }
     ?>
    <script type="text/javascript">
        //全局变量
        var GV = {
            ROOT: "/",
            WEB_ROOT: "/",
            JS_ROOT: "static/js/",
            APP: '<?php echo $_app; ?>'/*当前应用名*/,
            IS_MOBILE: <?php echo !empty($is_mobile) ? 'true'  :  'false'; ?>
        };
    </script>
    <script src="/themes/admin_simpleboot3/public/assets/js/jquery-1.12.4.min.js"></script>
    <script src="/themes/admin_simpleboot3/public/assets/js/jquery-migrate-1.4.1.min.js"></script>
<!--    <script src="/themes/admin_simpleboot3/public/assets/js/jquery-3.6.0.min.js"></script>-->
    <script src="/static/js/wind.js"></script>
    <script src="/themes/admin_simpleboot3/public/assets/js/bootstrap.min.js"></script>
    <script>
        Wind.css('artDialog');
        Wind.css('layer');
        $(function () {
            $("[data-toggle='tooltip']").tooltip({
                container: 'body',
                html: true,
            });
            $("li.dropdown").hover(function () {
                $(this).addClass("open");
            }, function () {
                $(this).removeClass("open");
            });
        });
    </script>
    <?php if(APP_DEBUG): ?>
        <style>
            #think_page_trace_open {
                z-index: 9999;
            }
        </style>
    <?php endif; ?>

<!-- 引入样式 -->
<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
</head>
<body>
	<div id="app" style="margin: 20px 60px;">
		<el-form :inline="true" :model="form" class="demo-form-inline">
			<div v-for="(item,index) in form">
				<el-form-item :label="'属性' + (index + 1)">
					<el-input v-model="item.attr" placeholder="属性 "></el-input>
				</el-form-item>
				<el-form-item :label="'属性值' + (index + 1)">
					<el-input v-model="item.attrVal" placeholder="属性值1,属性值2,属性值3"></el-input>
				</el-form-item>
				<el-button type="danger" @click="delForm(index)">移除属性</el-button>
			</div>
			<div>
				<el-form-item>
					<el-button type="default" @click="addForm">增加属性</el-button>
				</el-form-item>
			</div>
			<div>

				<el-form-item>
					<el-button type="primary" @click="onSubmit">保存</el-button>
				</el-form-item>
			</div>

		</el-form>
	</div>
	<!-- import Vue before Element -->
	<script src="https://unpkg.com/vue@2/dist/vue.js"></script>
	<!-- 引入组件库 -->
	<script src="https://unpkg.com/element-ui/lib/index.js"></script>
	<script src="/static/js/admin.js?v=<?php echo $_static_version; ?>"></script>
	<script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
	<script>
		v = new Vue({
			el: '#app',
			data: {
				form:[
					{attr:'',attrVal:''}
				],
				gid:'<?php echo $id; ?>'
			},
			methods: {
				//增加属性
				addForm ()
				{
					this.form.push({attr:'',attrVal:''})
				},
				//移除属性
				delForm(index)
				{
					this.form.splice(index,1);
				},
				//提交
				onSubmit ()
				{
					$.ajax({
						url:"<?php echo url('Goods/getAttrValPost'); ?>",
						type:'post',
						data:{
							form:this.form,
							gid:this.gid
						},
						success(res){
							if (res.code == 1) {
								v.$message({
									message: res.msg,
									type: 'success',
								});

								setTimeout(function () {
									location.reload()
								}, 1500);
							}else {
								v.$message({
									message: res.msg,
									type: 'error',
								});
							}

						},
						error(){
							v.$message({
								message: res.msg,
								type: 'error',
							});
						}

					})
				}
			}
		})
	</script>
</body>
</html>
